package com.shd.edanpei.enums;

import com.shd.edanpei.R;

/**
 * Created by mc on 2018/9/21.
 * yang-wen-wen
 */

public enum OrderTypeEnum {

    car(1, "车辆订单", R.drawable.pic_carloan2),
    house(2, "住房订单", R.drawable.pic_houseloan2),
    personal(4, "个人信用订单", R.drawable.pic_houseloan2),
    enterprise(5, "企业税金订单", R.drawable.pic_houseloan2),
    normal(3, "普通订单", 0);

    int key;
    String value;
    int imgID;

    OrderTypeEnum(int key, String value, int imgID) {
        this.key = key;
        this.value = value;
        this.imgID = imgID;
    }

    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static String getValue(int key) {
        if(car.key==key){
            return  car.value;
        }else if(house.key==key){
            return  house.value;
        }else if(personal.key==key){
            return  personal.value;
        }else if(enterprise.key==key){
            return enterprise.value;

        }
        return "创建订单";
    }

    public static int getImg(int key) {
        return key == car.key ? car.imgID : house.imgID;
    }


}
